<template>
	<!-- remove list-cell layer fix android 4.x overflow limit error: 28 layers! -->
	<!-- <view class="list-cell view" @click="click"></view> -->
	<view class="media-item view" hover-class="media-item-hover" v-if="options.title" @click="click">
		<!-- <view class="view" :style="options.article_type === 2 ? 'flex-direction: row';" :class="{'media-image-right': options.article_type === 2, 'media-image-left': options.article_type === 1}"> -->
		<!-- TODO 在支付宝小程序下 需要用 style 覆盖标签的默认样式 -->
		<view class="view">
			<view class="navList" v-for="(item,index) in goodsList" :key="item.id">
				<view class="item" @click="toPage(0,'/pages/goodsDetail/index?id='+item.id)">				
					<view class="imgBox"><image :src="item.imgUrl" mode=""></image></view>
					<view class="title">{{ item.title }}</view>
					<view class="price">{{ item.price }}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			options: {}
		},
		data(){
			return{
				goodsList:[{
							imgUrl:'../../../static/img/demo.png',
							id:0,
							title:"商品商品的哈岁的杀害大厦大厦的哈实打实的哈桑",
							price:"￥120.00"
						}]
			}
		},
		methods: {
			click() {
				this.$emit('click');
			},
			close(e) {
				this.$emit('close');
			}
		}
	}
</script>

<style lang="scss">
	.navList{
		display: flex;
		flex-direction: inherit;
		align-items: center;
		> .item{
			width: 100%;
			text-align: center;
			> .imgBox{
				width: 100%;
				height: 400upx;
				margin: 0 auto;
				border: 1px solid #eee;
				> image{
					width: 100%;
					height: 100%;
				}
			}
			> .price{
				text-align: left;
				padding: 15upx;
				color: $base-color;
			}
			> .title{
				height: 90upx;
				word-break: break-all;			
				text-overflow: ellipsis;						
				display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/						
				-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/						
				-webkit-line-clamp: 2; /** 显示的行数 **/						
				overflow: hidden;  /** 隐藏超出的内容 **/
				padding: 15upx;
				text-align: left;
			}
		}
	}

	.flex-row {
		flex-direction: row;
	}

	.flex-col {
		flex-direction: column;
	}

	.list-cell {
		width: 750rpx;
		padding: 0 30rpx;
	}

	.uni-list-cell-hover {
		background-color: #eeeeee;
	}

	.media-item {
		width: 350upx;
		position: relative;
		flex: 1;
		/* border-bottom-width: 1rpx;
		border-bottom-style: solid;
		border-bottom-color: #ebebeb; */
		padding: 20upx 20upx;
	}

    .media-item-hover{
        background-color: #eee;
    }

	.media-item-line {
		position: absolute;
		left: 30rpx;
		right: 30rpx;
		bottom: 0;
		height: 1rpx;
		background-color: #ebebeb;
	}

	.media-image-right {
		flex-direction: row;
	}

	.media-image-left {
		flex-direction: row-reverse;
	}

	.media-title {
		flex: 1;
	}

	.media-title {
		lines: 3;
		text-overflow: ellipsis;
		font-size: 30rpx;
		color: #555555;
	}

	.media-title2 {
		flex: 1;
		margin-top: 6rpx;
		line-height: 40rpx;
	}

	.image-section {
		margin-top: 20rpx;
		flex-direction: row;
		justify-content: space-between;
	}

	.image-section-right {
		margin-top: 0rpx;
		margin-left: 10rpx;
		width: 225rpx;
		height: 146rpx;
	}

	.image-section-left {
		margin-top: 0rpx;
		margin-right: 10rpx;
		width: 225rpx;
		height: 146rpx;
	}

	.image-list1 {
		width: 690rpx;
		height: 481rpx;
	}

	.image-list2 {
		width: 225rpx;
		height: 146rpx;
	}

	.image-list3 {
		width: 225rpx;
		height: 146rpx;
	}

	.media-info {
		flex-direction: row;
		align-items: center;
	}

	.info-text {
		margin-right: 20rpx;
		color: #999999;
		font-size: 24rpx;
	}

	.media-foot {
		margin-top: 25rpx;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.max-close-view {
		position: relative;
		align-items: center;
		flex-direction: row;
		width: 40rpx;
		height: 30rpx;
		line-height: 30rpx;
		border-width: 1rpx;
		border-style: solid;
		border-color: #aaaaaa;
		border-radius: 4px;
		justify-content: center;
		text-align: center;
	}

	.close-l {
		position: absolute;
		width: 18rpx;
		height: 1rpx;
		background-color: #aaaaaa;
	}

	.close-h {
		transform: rotate(45deg);
	}

	.close-v {
		transform: rotate(-45deg);
	}
</style>
